import requests

ip = "http://192.168.178.133:80"
loginData = {"username": "123", "password": "123456","act":"act_login","back_act":"http://192.168.178.133/index.php","submit":""}
s = requests.post(f"{ip}/user.php", data=loginData)
# print(s)
#获取
cookice = s.cookies
#新增
addLogData = {"msg_type":0,"msg_title":123333,"msg_content":366666,"act":"act_add_message"}
fname = r"D:\work\files\api\datas\tp.jpg"
fData = {"message_img":("tp.jpg",open(fname,"rb"),"image/png")}
s1 = requests.post(f"{ip}/user.php",data=addLogData,files=fData,cookies=cookice)
print(s1)
print(s1.text)



